package com.zl.tby.icc;

import lombok.Data;
import org.noear.wood.utils.StringUtils;

/**
 * 大华登录信息
 * @author changpeng
 * @version 1.0
 * @since 2024/9/15 10:04
 */
@Data
public class IccToken {
    private String magicId;
    private String user_name;
    private String scope;
    private Long expires_in;
    private String access_token;
    private String refresh_token;
    private String token_type;
    private String userId;
    private String client_id;

    public HttpRequestHeader[] getHeaderToken() {
        HttpRequestHeader[] header = new HttpRequestHeader[2];
        System.out.println(this.getToken_type() + " " + this.getAccess_token());
        header[0] = new HttpRequestHeader("Authorization", this.getToken_type() + " " + this.getAccess_token());
        header[1] = new HttpRequestHeader("User-Id", StringUtils.isEmpty(this.getUserId()) ? "1" : this.getUserId());
        return header;
    }
}
